package com.cby.operation.sdk.js

import android.content.Context
import android.webkit.JavascriptInterface
import com.cby.operation.common.util.CbyLogUtils
import com.cby.operation.common.util.WebUtils
import com.cby.operation.sdk.util.HykbAppUtils

/**
 * @description: BaseJsInterface
 *
 * @author ChenBaoyang
 * @date 7/23/21 14:50
 */
open class BaseJsInterface(private val context: Context) {


    /**
     * h5调用跳转到浏览器下载快爆APP
     */
    @JavascriptInterface
    fun onJumpToDownloadApp() {
        CbyLogUtils.flog("onJumpToDownloadApp")
        HykbAppUtils.openDownloadHykbApp(context)
    }

    /**
     * h5调用跳转到浏览器服务和隐私条款
     */
    @JavascriptInterface
    fun onJumpToWeb(url: String) {
        CbyLogUtils.flog("onJumpToWeb= $url")
        WebUtils.openUrl(context, url)
    }
}